import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import TabNavigator from './TabNavigator';
import zjh from '../screens/zjh/index';
import { navigationRef } from './navigationUtils';

// 定义路由参数类型
export type RootStackParamList = {
  Main: undefined;
  zjh: undefined;
  // 可以在这里添加其他页面路由参数
  // 例如：PetDetail: { petId: string };
};

// 创建堆栈导航器
const Stack = createStackNavigator<RootStackParamList>();

const AppNavigator = () => {
  return (
    <NavigationContainer ref={navigationRef}>
      <Stack.Navigator
        screenOptions={{
          headerShown: false,
        }}
      >
        <Stack.Screen name="Main" component={TabNavigator} />
        <Stack.Screen name="zjh" component={zjh} />
        {/* 可以在这里添加其他页面路由 */}
        {/* 例如：<Stack.Screen name="PetDetail" component={PetDetailScreen} /> */}
      </Stack.Navigator>
    </NavigationContainer>
  );
};

export default AppNavigator; 